package org.jeecg.modules.cosmetic.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.cosmetic.handler.ToxicologicalReportHandler;
import org.jeecg.modules.cosmetic.model.vo.DeleteVO;
import org.jeecg.modules.cosmetic.model.vo.ToxReportVO;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;

/**
 * <p>
 * 毒理数据库参考文献表 前端控制器
 * </p>
 *
 * @author lq
 * @since 2024-02-29 13:57:48
 */
@Api(tags = "毒理数据报告")
@RestController
@RequestMapping("/api/tox/report")
public class TToxicologicalReportController {

    @Resource
    private ToxicologicalReportHandler toxicologicalReportHandler;

    @ApiOperation(value = "删除报告", notes = "删除报告")
    @DeleteMapping(value = "/delete")
    public Result<?> delete(@RequestBody DeleteVO vo) {
        return Result.ok(toxicologicalReportHandler.delete(vo.getId()));
    }

    @ApiOperation(value = "查询报告", notes = "查询报告")
    @GetMapping(value = "/get")
    public Result<?> getToxReport(@RequestParam(value = "params" ,required = false) String params) {
        return Result.ok(toxicologicalReportHandler.getToxReport(params));
    }

    @ApiOperation(value = "新增报告", notes = "新增报告")
    @PostMapping(value = "/save")
    public Result<?> save(@RequestBody ToxReportVO vo) {
        return Result.ok(toxicologicalReportHandler.save(vo));
    }

}
